package com.sky.course.service.impl;

import com.sky.course.dao.CourseDao;
import com.sky.course.entity.Course;
import com.sky.course.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseDao courseDao;
    @Override
    public boolean add(Course course) {
        return courseDao.addCourse(course);
    }

    @Override
    public Course get(Integer cid) {
        return courseDao.findById(cid);
    }

    @Override
    public List<Course> list() {
        return courseDao.findAll();
    }
}
